<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 1、多行字符串
        //let str1 = 'Hi:\n My name is Gao';
        let str1 = `Hi:
                My name is Gao`;
        console.log(str1);

        // 2、字符串插入变量和表达式。变量名写在 ${} 中，${} 中可以放入 JavaScript 表达式。
        let name = "Mike"
        let age = 27
        let str2 = `My name is ${name}, my age is ${age+1}`;
        console.log(str2);//My Name is Mike,I am 28 years old next year.

        // 3、字符串中调用函数
        function f(){
            return "have fun!"
        }
        let str3 = `Game start,${f()}`
        console.log(str2);  // Game start,have fun!
    </script>
</body>
</html>